/* 滇西科技师范学院课程表展示系统样式 */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
}

/* 头部样式 */
header {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.class-card .card {
    height: 100%;
}

.class-card .card-body {
    display: flex;
    flex-direction: column;
}

.class-card .card-body .d-grid {
    margin-top: auto;
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* 课程表表格样式 */
#scheduleTable {
    font-size: 0.9rem;
}

#scheduleTable th {
    background-color: #343a40;
    color: white;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    padding: 12px 8px;
    border: 1px solid #495057;
}

#scheduleTable td {
    vertical-align: middle;
    padding: 2px;
    border: 1px solid #dee2e6;
    position: relative;
    height: 60px;
    min-width: 120px;
}

/* 当前时间红线 */
.now-line {
    position: absolute;
    left: 80px; /* 与时间列宽度匹配 */
    right: 0;
    height: 2px;
    background: #dc3545;
    z-index: 20;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(220,53,69,0.15);
}

.course-cell.current-course {
    outline: 2px solid rgba(220,53,69,0.6);
}

/* 今日列高亮 */
/* 今日列覆盖层（避免被rowspan影响错位） */
.today-col-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(13, 110, 253, 0.12);
    z-index: 10;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.25);
}

/* 时间段列样式 */
.time-slot {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    text-align: center;
    font-size: 0.8rem;
}

/* 课程单元格样式 */
.course-cell {
    color: white;
    border-radius: 6px;
    padding: 4px 6px;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    /* 让课程块在各浏览器中填满单元格（包含 Firefox） */
    top: 2px;
    right: 2px;
    bottom: 2px;
    left: 2px;
    overflow: hidden;
    /* 绝对定位后无需百分比高度，避免 Firefox 表格高度计算差异 */
    height: auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.course-cell:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10;
}

/* 合并课程的特殊样式 */
.course-cell.merged-course {
    padding: 8px 6px;
    font-size: 0.8rem;
    min-height: calc(100% - 0px);
}

/* 实验课程特殊标识 */
.course-cell.experiment::after {
    content: "实验";
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255,255,255,0.3);
    color: white;
    font-size: 0.6rem;
    padding: 1px 3px;
    border-radius: 2px;
}

/* 周末课程特殊标识 */
.course-cell.weekend::after {
    content: "周末";
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255,255,255,0.3);
    color: white;
    font-size: 0.6rem;
    padding: 1px 3px;
    border-radius: 2px;
}

/* 课程信息样式 */
.course-info {
    font-size: 0.7rem;
    line-height: 1.2;
    text-align: center;
    width: 100%;
}

.course-name {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 0.75rem;
}

.course-details {
    opacity: 0.9;
}

.course-details div {
    margin-bottom: 1px;
}

/* 节次信息样式 */
.period-info {
    font-weight: 600;
    font-size: 0.65rem;
    background: rgba(255,255,255,0.2);
    padding: 1px 4px;
    border-radius: 3px;
    margin: 2px 0;
    display: inline-block;
}

/* 合并课程的信息样式调整 */
.merged-course .course-info {
    font-size: 0.75rem;
}

.merged-course .course-name {
    font-size: 0.8rem;
    margin-bottom: 4px;
}

/* 课程详情卡片 */
.course-detail-card {
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.course-detail-card:hover {
    border-left-color: var(--success-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.course-detail-card.experiment {
    border-left-color: var(--danger-color);
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 搜索和筛选样式 */
.input-group-text {
    background-color: var(--light-color);
    border-color: #ced4da;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 徽章样式 */
.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
}

/* 主题选择器样式 */
.theme-option {
    transition: all 0.3s ease;
}

.theme-option:hover {
    background-color: #f8f9fa;
}

.theme-option.active {
    background-color: var(--primary-color);
    color: white;
}

.theme-option.active i {
    color: white !important;
}

/* 主题按钮样式 */
.theme-btn {
    height: 80px;
    text-align: left;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.theme-btn.active {
    border-width: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0;
    }

    .card-body {
        padding: 1rem;
    }

    #scheduleTable {
        font-size: 0.8rem;
    }

    #scheduleTable td {
        padding: 4px;
        height: 50px;
        min-width: 80px;
    }

    .course-cell {
        font-size: 0.7rem;
        padding: 2px 4px;
    }

    .merged-course {
        font-size: 0.75rem;
        padding: 4px;
    }

    .course-name {
        font-size: 0.7rem;
    }

    .merged-course .course-name {
        font-size: 0.75rem;
    }

    .period-info {
        font-size: 0.6rem;
    }

    .time-slot {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .class-card {
        margin-bottom: 1rem;
    }

    #scheduleTable {
        font-size: 0.7rem;
    }

    #scheduleTable td {
        padding: 2px;
        height: 40px;
        min-width: 60px;
    }

    .course-cell {
        font-size: 0.65rem;
        padding: 1px 2px;
    }

    .merged-course {
        font-size: 0.7rem;
        padding: 2px;
    }

    .course-name {
        font-size: 0.65rem;
        margin-bottom: 1px;
    }

    .merged-course .course-name {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }

    .period-info {
        font-size: 0.55rem;
        padding: 0px 2px;
    }

    .course-details div {
        margin-bottom: 0px;
    }
}

/* 打印样式 */
@media print {
    .btn, .loading-overlay, .modal {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    #scheduleTable {
        font-size: 0.8rem;
    }
    
    .course-cell {
        background: #f8f9fa !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.8rem;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
